package com.anlogic.sdk.efuse.model;

import java.util.ArrayList;
import java.util.List;

public enum AuthType {
	HEADER(0, "HEADER"), SM2(1, "SM2"), ECDSA256(2, "ECDSA256");
	
	private int id;
	
	private String name;
	
	AuthType(int id, String name) {
		this.id = id;
		this.name = name;
	}

	public int getId() {
		return this.id;
	}
	
	public String getName() {
		return this.name;
	}
	
	public static List<String> getAllNames() {
        List<String> list = new ArrayList<>();
        AuthType[] values = values();
        for(AuthType item : values) {
        	list.add(item.getName());
        }
        return list;
    }
	
	public static int getIdByName(String name) {
		AuthType[] values = values();
        for(AuthType item : values) {
        	if (item.getName().equals(name))
        		return item.getId();
        }
        return 0;
	}
}
